package jp.sourceforge.akjrcp.akj_betas.imagemagick;

import java.util.ArrayList;
import java.util.List;

public class ImageMagickCommandUtils {
	
	/**
	 * 
	 * @param convertPath convert.exe path
	 * @param inputs input images
	 * 
	 * @param output
	 * @param widht
	 * @param height
	 * @param frametime
	 * @param loop
	 * @return
	 */
public static String[] makeGifAnimeCommand(String convertPath,String[] inputs,String output,int width,int height,int frametime,int loop){

List<String> command=new ArrayList<String>();
command.add(convertPath);
command.add("-geometry");
command.add(width+"x"+height);
command.add("-delay");
command.add(""+frametime);
command.add("-loop");
command.add(""+loop);
for (int i = 0; i < inputs.length; i++) {
	command.add(inputs[i]);
}

command.add(output);

return command.toArray(new String[command.size()]);
}

public static String[] makeMontageCommand(String montagePath,String[] inputs,String output,int width,int height,int x,int y){

	List<String> command=new ArrayList<String>();
	command.add(montagePath);
	command.add("-geometry");
	command.add(width+"x"+height);
	command.add("-tile");
	command.add(x+"x"+y);
	for (int i = 0; i < inputs.length; i++) {
		command.add(inputs[i]);
	}

	command.add(output);

	return command.toArray(new String[command.size()]);
	}
}
